//
//  imageCell.m
//  Focus
//
//  Created by dlios on 14-11-9.
//  Copyright (c) 2014年 lanou3g.com 蓝鸥科技. All rights reserved.
//

#import "imageCell.h"

@implementation imageCell
-(void)dealloc{
    [super dealloc];
    [_imageOne release];
    [_imageTwo release];
    [_imageThr release];
    [_imageFou release];
    [_imageFive release];
    [_imageSix release];
    [_imageSeven release];
    [_imageEight release];
}
- (id)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        // Initialization code
        UIImageView *imageOne = [[UIImageView alloc]initWithFrame:CGRectZero];
        self.imageOne = imageOne;
        [imageOne release];
        [self.contentView addSubview:self.imageOne];
        
        UIImageView *imageTwo = [[UIImageView alloc]initWithFrame:CGRectZero];
        self.imageTwo = imageTwo;
        [imageTwo release];
        [self.contentView addSubview:self.imageTwo];
        
        UIImageView *imageThr = [[UIImageView alloc]initWithFrame:CGRectZero];
        self.imageThr = imageThr;
        [imageThr release];
        [self.contentView addSubview:self.imageThr];
        
        UIImageView *imageFou = [[UIImageView alloc]initWithFrame:CGRectZero];
        self.imageFou = imageFou;
        [imageFou release];
        [self.contentView addSubview:self.imageFou];
        
         UIImageView *imageFive = [[UIImageView alloc]initWithFrame:CGRectZero];
        self.imageFive = imageFive;
        [imageFive release];
        [self.contentView addSubview:self.imageFive];
        
        UIImageView *imageSix = [[UIImageView alloc]initWithFrame:CGRectZero];
        self.imageSix = imageSix;
        [imageSix release];
        [self.contentView addSubview:self.imageSix];
        
        UIImageView *imageSeven = [[UIImageView alloc]initWithFrame:CGRectZero];
        self.imageSeven = imageSeven;
        [imageSeven release];
        [self.contentView addSubview:self.imageSeven];
        
        UIImageView *imageEight = [[UIImageView alloc]initWithFrame:CGRectZero];
        self.imageEight = imageEight;
        [imageEight release];
        [self.contentView addSubview:self.imageEight];
        
        
    }
    return self;
}
-(void)layoutSubviews{
    [super layoutSubviews];
    CGFloat height = self.contentView.frame.size.height;
    CGFloat width = self.contentView.frame.size.width;
    self.imageOne.frame = CGRectMake(2, 0, width / 3 - 5, height/ 4 - 7);
    self.imageTwo.frame = CGRectMake(width / 3 , 0, width / 3 - 2, height / 4 - 7);
    self.imageThr.frame = CGRectMake(width / 3 * 2 , 0, width / 3 - 2, height / 4 - 7);
    self.imageFou.frame = CGRectMake(2, height / 4 - 5, width / 3 - 5, height / 4 - 7);
    self.imageFive.frame = CGRectMake(width / 3 - 1 , height / 4 - 5, width / 3 * 2 - 1, height / 4 - 7);
    self.imageSix.frame = CGRectMake(2, height / 4 * 2 - 10, width / 3 - 5, height / 4 - 7);
    self.imageSeven.frame = CGRectMake(2, height / 4 * 3 - 15, width / 3 - 5, height / 4 - 7);
    self.imageEight.frame = CGRectMake(width / 3  , height / 4 * 2 - 10, width / 3 * 2 - 2, height / 4 * 2 - 2- 10);
    self.imageOne.image = [UIImage imageNamed:@"backgrand.jpg"];
    self.imageOne.backgroundColor = [UIColor redColor];
    self.imageTwo.backgroundColor = [UIColor redColor];
    self.imageThr.backgroundColor = [UIColor redColor];
    self.imageFou.backgroundColor = [UIColor redColor];
    self.imageFive.backgroundColor = [UIColor redColor];
    self.imageSix.backgroundColor = [UIColor redColor];
    self.imageSeven.backgroundColor = [UIColor redColor];
    self.imageEight.backgroundColor = [UIColor redColor];
}
/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect
{
    // Drawing code
}
*/

@end
